<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view');
//require_once(JPATH_COMPONENT.DS.'models'.DS.'manage.php');

class SimplelistingViewManage extends JView
{

	function display($tpl = null){
            global $mainframe, $context;
            $model      =& $this->getModel();
            $document   =& JFactory::getDocument();
            $params = &JComponentHelper::getParams( 'com_simplelisting');
            $db         =& JFactory::getDBO();
            $uri        =& JFactory::getURI();
            $user       =& JFactory::getUser();
            $priceLabel       = $params->get('price_label', '');
            $categoryLabel    = $params->get('category_label', '');
            $addressLabel     = $params->get('address_label', '');
            $typeLabel        = $params->get('type_label', '');
            $countryLabel     = $params->get('country_label', '');
            $extrasLabel      = $params->get('extras_label', '');
            $layoutLabel      = $params->get('layout_label', '');
            $facilitiesLabel  = $params->get('facilities_label', '');
            $postedLabel      = $params->get('posted_label', '');
            $descriptionLabel = $params->get('description_label', '');
            $nameLabel        = $params->get('name_label', '');
            $publishedLabel   = $params->get('published_label', '');
            $select_theme     = $params->get('select_theme', '');

            $items	=& $this->get( 'Data');
            $total	=& $this->get( 'Total');
            $pagination =& $this->get( 'Pagination' );

            $this->assignRef('lists',               $lists);
            $this->assignRef('user',                $user);
            $this->assignRef('items',               $items);
            $this->assignRef('pagination',          $pagination);
            $this->assignRef('request_url',         $uri->toString());
            $this->assignRef('params',              $params) ;
            $this->assignRef('price_label',         $priceLabel);
            $this->assignRef('category_label',      $categoryLabel);
            $this->assignRef('type_label',          $typeLabel);
            $this->assignRef('address_label',       $addressLabel);
            $this->assignRef('country_label',       $countryLabel);
            $this->assignRef('extras_label',        $extrasLabel);
            $this->assignRef('layout_label',        $layoutLabel);
            $this->assignRef('facilities_label',    $facilitiesLabel);
            $this->assignRef('posted_label',        $postedLabel);
            $this->assignRef('description_label',   $descriptionLabel);
            $this->assignRef('name_label',          $nameLabel);
            $this->assignRef('published_label',     $publishedLabel);
            $this->assignRef('select_theme',        $select_theme);

            parent::display($tpl);
        }

	function displayEdit($simplelistingId){
            $model = $this->getModel();
            $simplelisting = $model->getSimplelistingLists($simplelistingId);
            $params = &JComponentHelper::getParams( 'com_simplelisting');
            $priceLabel       = $params->get('price_label', '');
            $categoryLabel    = $params->get('category_label', '');
            $addressLabel     = $params->get('address_label', '');
            $typeLabel        = $params->get('type_label', '');
            $countryLabel     = $params->get('country_label', '');
            $extrasLabel      = $params->get('extras_label', '');
            $layoutLabel      = $params->get('layout_label', '');
            $facilitiesLabel  = $params->get('facilities_label', '');
            $postedLabel      = $params->get('posted_label', '');
            $descriptionLabel = $params->get('description_label', '');
            $nameLabel        = $params->get('name_label', '');
            $publishedLabel   = $params->get('published_label', '');
            $select_theme     = $params->get('select_theme', '');

         
            $this->assignRef('params', $params) ;
            $this->assignRef('price_label', $priceLabel);
            $this->assignRef('category_label', $categoryLabel);
            $this->assignRef('type_label', $typeLabel);
            $this->assignRef('address_label', $addressLabel);
            $this->assignRef('country_label', $countryLabel);
            $this->assignRef('extras_label', $extrasLabel);
            $this->assignRef('layout_label', $layoutLabel);
            $this->assignRef('facilities_label', $facilitiesLabel);
            $this->assignRef('posted_label', $postedLabel);
            $this->assignRef('description_label', $descriptionLabel);
            $this->assignRef('name_label', $nameLabel);
            $this->assignRef('published_label', $publishedLabel);
            $this->assignRef('simplelisting', $simplelisting);
            $this->assignRef('select_theme',        $select_theme);
            
            parent::display();
	}

	function displayAdd(){
            $model = $this->getModel();
            $simplelisting = $model->getNewSimplelisting();
            $params = &JComponentHelper::getParams( 'com_simplelisting');
            $priceLabel      = $params->get('price_label', '');
            $categoryLabel   = $params->get('category_label', '');
            $addressLabel    = $params->get('address_label', '');
            $typeLabel       = $params->get('type_label', '');
            $countryLabel    = $params->get('country_label', '');
            $extrasLabel     = $params->get('extras_label', '');
            $layoutLabel     = $params->get('layout_label', '');
            $facilitiesLabel = $params->get('facilities_label', '');
            $postedLabel     = $params->get('posted_label', '');
            $select_theme     = $params->get('select_theme', '');

            $this->assignRef('params', $params) ;
            $this->assignRef('price_label', $priceLabel);
            $this->assignRef('category_label', $categoryLabel);
            $this->assignRef('type_label', $typeLabel);
            $this->assignRef('address_label', $addressLabel);
            $this->assignRef('country_label', $countryLabel);
            $this->assignRef('extras_label', $extrasLabel);
            $this->assignRef('layout_label', $layoutLabel);
            $this->assignRef('facilities_label', $facilitiesLabel);
            $this->assignRef('posted_label', $postedLabel);
            $this->assignRef('description_label', $descriptionLabel);
            $this->assignRef('name_label', $nameLabel);
            $this->assignRef('published_label', $publishedLabel);
            $this->assignRef('simplelisting', $simplelisting);
            $this->assignRef('select_theme',        $select_theme);

            parent::display();
	}
    }
?>
